<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Type</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/layui/css/layui.css">

    <link rel="icon" href="${pageContext.request.contextPath}/assets/images/favicon.png" type="image/png">
    <title>Home</title>
    <!--Begin  Page Level  CSS -->
    <link href="${pageContext.request.contextPath}/assets/plugins/morris-chart/morris.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet"/>
    <!--End  Page Level  CSS -->
    <link href="${pageContext.request.contextPath}/assets/css/icons.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/style.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/responsive.css" rel="stylesheet">
    <script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-144208445-2"></script>
    <script>window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'UA-144208445-2');</script>
    <script>var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?8b02a318fde5831da10426656a43d03c";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();</script>
    <link href="${pageContext.request.contextPath}/assets/css/style.css" rel="stylesheet">
</head>
<body class="sticky-header">


<!--Start left side Menu-->
<jsp:include page="../inc/left.jsp"/>
<!--End left side menu-->

<!-- main content start-->
<div class="main-content">
    <!-- header section start-->
    <jsp:include page="../inc/header.jsp"/>
    <!-- header section end-->


    <!--body wrapper start-->
    <div class="wrapper">

        <!--Start Page Title-->
        <div class="page-title-box">
            <h4 class="page-title">添加商品属性</h4>
            <ol class="breadcrumb">
                <li>
                    <a href="${pageContext.request.contextPath}/index">首页</a>
                </li>
                <li>
                    <a href="#">商品</a>
                </li>
                <li class="active">
                    添加商品属性
                </li>
            </ol>
            <div class="clearfix"></div>
        </div>
        <!--End Page Title-->

        <!--Start row-->
        <br>
        <div class="col-md-12">
            <div class="white-box">
                <br>
                <h3>${types==0?'添加属性':types==1?'添加参数':''}</h3>
                <h3>${ids!=null?'修改属性':''}</h3>
                <br>

                <form data-v-53def753="" method="post"
                      action="${pageContext.request.contextPath}/goods/typeAttributeListSave?per=${id!=null?id:per}&ids=${ids!=null?ids:null}&type=${types!=null?types:type}"
                      class="el-form" style="width:600px;margin-left: 20%;">

                    <div class="el-form-item__content">
                        <div data-v-53def753="" class="el-form-item is-required"><label
                                class="el-form-item__label"
                                style="width: 150px;display: inline-block"><span
                                style="color: red">*</span>属性名称：</label>
                            <input name="name" type="text" autocomplete="off" required="required"
                                   class="el-input__inner"
                                   style="width: 400px;text-align: center;border: 1px solid rgb(221,221,221);outline: none"
                                   value="${productAttribute!=null?productAttribute.name:''}">
                        </div>
                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item"><label
                            class="el-form-item__label"
                            style="width: 150px;">商品类型：</label>
                        <select name="productAttributeCategoryId" required="required"
                                style="width: 400px;text-align: center;border: 1px solid rgb(221,221,221)">
                            <c:forEach items="${PAC}" var="p">
                                <c:if test="${productAttribute.productAttributeCategoryId==p.id || p.id==id}">
                                    <option selected value="${p.id}">${p.name}</option>
                                </c:if>
                                <c:if test="${productAttribute.productAttributeCategoryId!=p.id}">
                                    <option value="${p.id}">${p.name}</option>
                                </c:if>
                            </c:forEach>

                        </select>
                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item">
                        <label class="el-form-item__label"
                               style="width: 150px;">分类筛选样式:</label>
                        <c:if test="${productAttribute.filterType==null}">
                            <label>
                                <input type="radio" name="filterType" value="0" checked="checked" style="outline: none">普通
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="filterType" value="1" style="outline: none">颜色
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.filterType==0}">
                            <label>
                                <input type="radio" name="filterType" value="0" checked="checked" style="outline: none">普通
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="filterType" value="1" style="outline: none">颜色
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.filterType==1}">
                            <label>
                                <input type="radio" name="filterType" value="0" >普通
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="filterType" value="1" checked="checked">颜色
                            </label>
                        </c:if>

                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item">
                        <label class="el-form-item__label"
                               style="width: 150px;">能否进行检索:</label>
                        <c:if test="${productAttribute==null}">
                            <label>
                                <input type="radio" name="searchType" value="0" checked="checked">不需要进行检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="1">关键字检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="2">范围检索
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.searchType==0}">
                            <label>
                                <input type="radio" name="searchType" value="0" checked="checked">不需要进行检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="1">关键字检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="2">范围检索
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.searchType==1}">
                            <label>
                                <input type="radio" name="searchType" value="0" >不需要进行检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="1" checked="checked">关键字检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="2">范围检索
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.searchType==2}">
                            <label>
                                <input type="radio" name="searchType" value="0" >不需要进行检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="1">关键字检索
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="searchType" value="2" checked="checked">范围检索
                            </label>
                        </c:if>
                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item">
                        <label class="el-form-item__label"
                               style="width: 150px;">商品属性关联:</label>
                        <c:if test="${productAttribute==null}">
                            <label>
                                <input type="radio" name="relatedStatus" value="0" checked="checked">不关联
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="relatedStatus" value="1" >关联
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.relatedStatus==0}">
                            <label>
                                <input type="radio" name="relatedStatus" value="0" checked="checked">不关联
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="relatedStatus" value="1" >关联
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.relatedStatus==1}">
                            <label>
                                <input type="radio" name="relatedStatus" value="0" >不关联
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="relatedStatus" value="1" checked="checked">关联
                            </label>
                        </c:if>

                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item">
                        <label class="el-form-item__label"
                               style="width: 150px;">是否支持手动新增:</label>
                        <c:if test="${productAttribute==null}">
                            <label>
                                <input type="radio" name="handAddStatus" value="0" checked="checked">不支持
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="handAddStatus" value="1" >支持
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.handAddStatus==0}">
                            <label>
                                <input type="radio" name="handAddStatus" value="0" checked="checked">不支持
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="handAddStatus" value="1" >支持
                            </label>
                        </c:if>
                        <c:if test="${productAttribute.handAddStatus==1}">
                            <label>
                                <input type="radio" name="handAddStatus" value="0" >不支持
                            </label>
                            &emsp;&emsp;
                            <label>
                                <input type="radio" name="handAddStatus" value="1" checked="checked">支持
                            </label>
                        </c:if>

                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item">
                        <label class="el-form-item__label"
                               style="width: 150px;">属性是否可选:</label>
                        <select name="selectType" required="required"
                                style="width: 400px;text-align: center;border: 1px solid rgb(221,221,221)">
                            <option ${productAttribute.selectType==0?'selected':''} value="0">唯一</option>
                            <option ${productAttribute.selectType==1?'selected':''} value="1">单选</option>
                            <option ${productAttribute.selectType==2?'selected':''} value="2">多选</option>
                        </select>
                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item">
                        <label class="el-form-item__label" style="width: 150px;">属性值可选值列表:</label>
                        <select name="inputList" required="required" size="5" multiple="multiple"
                                style="width: 400px;background-color: gainsboro;text-align: center;border: 1px solid rgb(221,221,221)">
                            <c:forEach items="${productAttributeValues}" var="pro">
                                <c:if test="${pro.value!=null}">
                                    <c:if test="${productAttribute.inputList.contains(pro.value)}">
                                        <option selected style="color: aqua" value="${pro.value}">${pro.value}</option>
                                    </c:if>
                                    <c:if test="${!productAttribute.inputList.contains(pro.value)}">
                                        <option value="${pro.value}">${pro.value}</option>
                                    </c:if>

                                </c:if>
                            </c:forEach>
                        </select>
                    </div>
                    <br>
                    <div data-v-53def753="" class="el-form-item">
                        <label class="el-form-item__label" style="width: 150px;">优先级：
                            <output style="display: inline" for="i1" id="sort0"></output>
                        </label>
                        <input style="display: inline;width: 400px;background: grey" id="i1" type="range"
                               value="${productAttribute!=null?productAttribute.sort:''}" min="0" max="100" step="10"
                               name="sort" onchange="sort0.value = this.value">

                    </div>
                    <div data-v-53def753="" class="el-form-item">
                        <div class="el-form-item__content" style="margin-left: 45%;">
                            <button style="outline: none" data-v-53def753="" type="submit" class="btn btn-success"><span>提交</span></button>
                            <span>
                                <a style="width: 54px;height: 33px;text-align: center;padding: 6px 10px 8px 10px;background-color: grey;color: white;outline: none"
                                   href="${pageContext.request.contextPath}/goods/typeAttributeList/${tt==1?'add?id':'change?ids'}=${id!=null?id:ids}&types=${types!=null?types:type}"><span>重置</span></a>
                            </span>
                        </div>
                    </div>
                </form>

            </div>
        </div>
    </div>
    <!--End row-->
</div>
<!-- End Wrapper-->
<!--Start Footer -->
<jsp:include page="../inc/footer.jsp"/>
<!--End footer -->
<!--End main content -->
<!--Begin core plugin -->
<script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/plugins/moment/moment.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.slimscroll.js "></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.nicescroll.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/functions.js"></script>
<!-- End core plugin -->
<!--Begin Page Level Plugin-->
<script src="${pageContext.request.contextPath}/assets/pages/table-data.js"></script>
<script src="${pageContext.request.contextPath}/assets/layui/layui.js"></script>
<!--End Page Level Plugin-->

</body>
</html>
